package com.czf.alibaba_web.controller;

import com.alibaba.csp.sentinel.annotation.SentinelResource;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import java.util.Date;

/**
 * @author: create by czf
 * @version: v1.0
 * @description: com.czf.alibaba_web
 * @date: 2020-03-23 17:23
 **/
@RestController
@RequestMapping("/web")
@Api(tags = "web用户信息模块")
public class WebController {

    /**
     * http://localhost:8100/web/getInfo
     * @return
     */
    @GetMapping("getInfo")
    @ApiOperation("获取用户信息")
    public String getInfo(HttpServletRequest request){
        System.out.println("用户ID：" + request.getHeader("Authorization-UserName"));
        return "我是web" + new Date();
    }

    @GetMapping("getA")
    @ApiOperation("获取A信息")
    public String getA(){
        System.out.println("进来web的getA方法" + new Date());
        return "我是A" + new Date();
    }

    @GetMapping("getB")
    @ApiOperation("获取B信息")
    public String getB(){
        return "我是B" + new Date();
    }
}
